<%

String mysJDBCDriver = "com.mysql.jdbc.Driver"; 
String mysURL = "jdbc:mysql://mysql2.cs.stonybrook.edu:3306/jedale"; 
String mysUserID = "jedale"; 
String mysPassword = "107200855";
java.sql.Connection conn=null;
  			

		try 
		{
			int custID = (Integer)session.getValue("customerID");
			
        	Class.forName(mysJDBCDriver).newInstance();
			java.util.Properties sysprops=System.getProperties();
			sysprops.put("user",mysUserID);
			sysprops.put("password",mysPassword);
    
			//connect to the database
        	conn=java.sql.DriverManager.getConnection(mysURL,sysprops);
        	java.sql.Statement stmt1=conn.createStatement();
        	
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupBid' From Bid");
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupPost' From Post");
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupAuc' From Auction");
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupItem' From Item");
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupCustomer' From Customer");
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupEmployee' From Employee");
        	stmt1.executeQuery("Select * INTO OUTFILE 'backupPerson' From Person");
        	
        	stmt1.close();

		} catch(Exception e)
		{
			e.printStackTrace();
			out.print(e.toString());
		}
		finally{
		
			try{conn.close();}catch(Exception ee){};
		}
		
		response.sendRedirect("ManageEmployees.jsp");
%>